package com.pig4cloud.pigx.contract.open.api.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.pig4cloud.pigx.common.customize.utils.serializer.BigDecimalToPlainStringSerializer;
import com.pig4cloud.pigx.contract.annotation.SetScaleMainCurrency;
import com.pig4cloud.pigx.contract.annotation.SetScaleTokenCurrency;
import lombok.Data;
import org.springframework.data.mongodb.core.index.Indexed;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 */
@Data
public class OpenApiOrderBookVOV1 implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 币对名称
	 */
	private String symbolName;

	/**
	 * 价格，市价单时为空
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency()
	private BigDecimal price;

	/**
	 * 数量
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleTokenCurrency
	@Indexed(useGeneratedName = true)
	private BigDecimal num;

}
